<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/26 0026
 * Time: 下午 2:40
 */
namespace app\message\controller\chat;
use app\common\api\AApi;

class Api extends AApi{
    /**
     * 初始化配置
     * @param array $config
     */
    public function __construct(array $config = []){
        parent::__construct();
    }

    /**
     * 用户对象
     */
    static public $obj;

    /**
     * 单列模式实例化对象
     */
    static function getInstance(){
        $data = self::$post_data;
        self::$obj = new Chat_mes($data);
        return self::$obj;
    }

    /**
     * 添加
     */
    public function chat_add(){
        $obj = self::getInstance();
        $res = $obj->chat_add();
        return create_callback($res);
    }
    /**
     * 删除
     */
    public function chat_edit(){
        $obj =self::getInstance();
        $res = $obj->chat_edit();
        return create_callback($res);
    }
    /**
     * 列表
     */
    public function chat_list(){
        $obj=self::getInstance();
        $res =$obj->chat_list();
        return create_callback($res);
    }

    public function chat_list_child(){
        $obj=self::getInstance();
        $res =$obj->chat_list_child();
        return create_callback($res);
    }
}